package com.shell.provider;

import com.shell.governor.modules.po.PubProtocol;
import com.shell.governor.modules.service.PubProtocolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubProtocolProvider
{
  @Autowired
  private PubProtocolService pubProtocolService;
  
  @RequestMapping({"/pub-protocol/getPubProtocolByTypeAndGrpId"})
  public PubProtocol getPubProtocolByTypeAndGrpId(@RequestParam("protoType") String protoType, @RequestParam(value="grpId", required=false) String grpId, @RequestParam(value="finId", required=false) String finId)
  {
    return this.pubProtocolService.selectProtocolByGpAndType(finId, grpId, protoType);
  }
  
  @RequestMapping({"/pub-protocol/getPubProtocolDetailById"})
  public PubProtocol getPubProtocolDetailById(@RequestParam("protoId") String protoId)
  {
    return (PubProtocol)this.pubProtocolService.selectByKey(protoId);
  }
  
  @RequestMapping({"/pub-protocol/getAuthProtocolDetail"})
  public PubProtocol getAuthProtocolDetail()
  {
    return this.pubProtocolService.selectAuthProtocol();
  }
}
